#ifndef ACAPELLA_THREAD_LINUX_THREAD_HPP
#define ACAPELLA_THREAD_LINUX_THREAD_HPP

namespace acapella
{
namespace thread
{

class Thread_Linux
{
public:
	typedef _thread_traits<acapella_os_linux>::ThreadHandle ThreadHandle;
	typedef _thread_traits<acapella_os_linux>::ThreadParam ThreadParam;
	typedef _thread_traits<acapella_os_linux>::ThreadFunc ThreadFunc;

	static int Current()
	{
		return ::pthread_self();
	}

	static int Cleanup(ThreadHandle /*handle*/)
	{
		return 0;
	}

	static int Create(ThreadHandle* pHandle, _uint32_ /*stackSize*/, ThreadFunc func, ThreadParam param)
	{
		return ::pthread_create(pHandle, NULL, func, param);
	}

	static int Exit(_uint32_ retcode)
	{
		::pthread_exit((void**)retcode);
		return 0;
	}

	static int Join(ThreadHandle handle, void ** rval_ptr)
	{
		return ::pthread_join(handle, rval_ptr);
	}


};


}
}


#endif

